﻿using Xunit;
using System.Linq;

namespace Gamemaster.Naming
{
    public class LinqNameDatabaseTests
    {
        [Fact]
        public void DatabaseExists()
        {
            LinqNameDatabase context = (LinqNameDatabase)new LinqDatabaseFactory().CreateDatabase();

            Assert.True(context.DatabaseExists());
        }

        [Fact]
        public void FirstRecordsExist()
        {
            LinqNameDatabase context = (LinqNameDatabase)new LinqDatabaseFactory().CreateDatabase();

            Assert.True(context.Firsts.Any());
        }

        [Fact]
        public void FirstContainsMaleNames()
        {
            LinqNameDatabase context = (LinqNameDatabase)new LinqDatabaseFactory().CreateDatabase();

            Assert.True(context.Firsts.Any(f => f.Gender == "Male"));
        }

        [Fact]
        public void FirstContainsFemaleNames()
        {
            LinqNameDatabase context = (LinqNameDatabase)new LinqDatabaseFactory().CreateDatabase();

            Assert.True(context.Firsts.Any(f => f.Gender == "Female"));
        }
    }
}
